package com.mxpio.erp.common.jpa.model;

import com.mxpio.erp.common.jpa.policy.NoticeCodeGeneratorPolicy;
import com.mxpioframework.jpa.BaseEntity;
import com.mxpioframework.jpa.annotation.Generator;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * 通知单
 * @author MxpIO
 */
@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper=false)
public abstract class BizNotice extends BaseEntity {

	private static final long serialVersionUID = 1L;

	public BizNotice(){
		super();
		this.setTypeCode(initTypeCode());
	}

	@Id
	@Column(name = "NOTICE_NO_", updatable = false)
	@Generator(policy = NoticeCodeGeneratorPolicy.class)
	@ApiModelProperty(value = "通知单号")
	private String noticeNo;

	@Column(name = "NOTICE_STATUS_")
	@ApiModelProperty(value = "单据状态")
	private String noticeStatus;

	@Column(name = "TYPE_CODE_")
	@ApiModelProperty(value = "通知类型")
	private String typeCode;

	@Column(name = "BIZ_ORDER_NO_")
	@ApiModelProperty(value = "业务单号")
	private String bizOrderNo;

	@Column(name = "WAREHOUSE_")
    @ApiModelProperty(value = "仓库")
    private String warehouse;

	@Column(name = "NOTICE_DATE_")
	@ApiModelProperty(value = "通知时间")
	private Date noticeDate;

	public abstract String initTypeCode();

}
